package com.metaverse.backend.repo;

import com.metaverse.backend.domain.PlayerData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

/**
 * 用户数据
 *
 */
public interface PlayerDataRepo extends JpaRepository<PlayerData, Long>, JpaSpecificationExecutor<PlayerData> {


    /**
     * 查找用户数据
     * @param secOpenid
     * @return
     */
    @Query("select pd from PlayerData  pd where pd.sec_openid = ?1 ")
    Optional<PlayerData> findBySecOpenid(String secOpenid);


}
